INTDIR = ./obj
OUTDIR = ./bin
PLUGIN_INCLUDES = \
	-I/usr/include

CFLAGS = -g -DDEBUG -Wall
	
LIB_PATH = -L/usr/lib

LIBS = 

CC = gcc

OBJS = \
	$(INTDIR)/scan.o \
	$(INTDIR)/parse.o \
	$(INTDIR)/testmain.o \
	$(INTDIR)/interpret.o \
	$(INTDIR)/int_exec.o \
	$(INTDIR)/int_expr.o \
	$(INTDIR)/testexec.o

TARGET = $(OUTDIR)/logo

exefile : all
all : $(TARGET)

$(TARGET) : checkdir $(OBJS)
	g++ -o $(TARGET) $(OBJS) $(LIB_PATH) $(LIBS)

checkdir:
	@if test ! -d $(OUTDIR);	\
	then	\
		mkdir $(OUTDIR);	\
	fi
	@if test ! -d $(INTDIR);	\
	then	\
		mkdir $(INTDIR);	\
	fi

	
$(INTDIR)/scan.o : scan.cpp
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ scan.cpp

$(INTDIR)/parse.o : parse.cpp
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ parse.cpp

$(INTDIR)/testexec.o : testexec.cpp 
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ testexec.cpp

$(INTDIR)/testmain.o : testmain.cpp 
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ testmain.cpp

$(INTDIR)/interpret.o : interpret.cpp 
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ interpret.cpp

$(INTDIR)/int_exec.o : int_exec.cpp 
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ int_exec.cpp

$(INTDIR)/int_expr.o : int_expr.cpp 
	$(CC) $(PLUGIN_INCLUDES) $(CFLAGS) -c -o $@ int_expr.cpp

clean:
	rm -f $(INTDIR)/* $(TARGET) *~ *.bak $(OUTDIR)/*.exe


